# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=lomiri-trust-store
pkgver=0_git20231017
_commit="7aa7ab5b7f3843e24c13ae6d9b8607455296d60e"
pkgrel=0
pkgdesc="API for creating, reading, updating and deleting trust requests answered by users"
url="https://gitlab.com/ubports/development/core/trust-store"
arch="all"
license="LGPL-3.0-only"
depends_dev="
	boost-dev
	dbus-cpp-dev
	libapparmor-dev
	mir-dev
	process-cpp-dev
	properties-cpp-dev
	qt5-qtdeclarative-dev
	"
makedepends="
	$depends_dev
	cmake
	cmake-extras
	gmock
	gtest-dev
	libapparmor
	samurai
	"
checkdepends="
	coreutils
	dbus
	"
source="https://gitlab.com/ubports/development/core/trust-store/-/archive/$_commit/trust-store-$_commit.tar.gz
	no_werror.patch
	"
subpackages="$pkgname-dev $pkgname-lang"
builddir="$srcdir/trust-store-$_commit"
options="!check" # some tests fail

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=None \
		-DTRUST_STORE_MIR_AGENT_ENABLED=OFF
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
40ce6245d8ffddd39e4fac5272c11ae8697d866d7d3dc89a99039cfc54cfa21e6d16fe83709193da467e2e49470a401f6e092a3213054cc0b73eab087c7c9d00  trust-store-7aa7ab5b7f3843e24c13ae6d9b8607455296d60e.tar.gz
cb8d3c1bfaa6e13999fee7edda6418a6cf6a41d1ff356f1727ff390955c6230789af4b2585de85ba62f50d3f78f80d1b2cc659e2d291c8407393c76fa546c7f1  no_werror.patch
"
